1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method that perform error diffusion on multivalued image data composed of a plurality of density components and outputs the error diffusion result, and a program for implementing the image processing method, as well as a storage medium storing the program.
2. Description of the Related Art
Conventionally, an error diffusing process has been known as a dithering process in which multivalued images are expressed in binary notation (“An Adaptive Algorithm for Spatial Gray Scale” in Society for Information Display 1975 Symposium Digest of Technical Papers, 1975, 36). In this process, where a notice pixel is designated by P, the density thereof is designated by v, the densities of peripheral pixels P0, P1, P2, P3 around the notice pixel P are designated by v0, v1, v2, and v3, respectively, and a binarization threshold is designated by T, a binarization error E of the notice pixel P is distributed to the peripheral pixels P0, P1, P2, and P3 by respective weighting factors W0, W1, W2, and W3 found empirically so that the average density can be macroscopically equal to the density of the original image.
For example, where binary data to be outputted is designated by o, the output binary data, binarization error E, the densities v0, v1, v2, and v3 of the peripheral pixels P1, P1, P2, and P3 are expressed by:if v≧T, o=1 and E=v−Vmaxif v<T, o=0 and E=v−Vmin  (1)
(Vmax: maximum density, Vmin: minimum density)v0=v0+E×W0  (2)v1=v1+E×W1  (3)v2=v2+E×W2  (4)v3=v3+E×W3  (5)
(Examples of the weighting factors: W0= 7/16, W1= 1/16, W2= 5/16, and W3= 3/16)
As an example of methods for performing the error diffusion at high speed, a method has been proposed in Japanese Laid-Open Patent Publication (Kokai) No. 63-35074 in which a value of a binarization error weighted in advance is determined for every value of density information such that the sum of the determined values is equal to the binarization error, thus simplifying multiplications and divisions and eliminating roundoff errors.
A description will now be given of the above method with reference to FIGS. 14A and 14B. FIG. 14A is a view showing the relationship between density values of cyan and magenta and output values thereof according to the conventional error diffusion method, and FIG. 14B is a view showing an example of a table of total cyan density values and weighted diffusion error values for use in the conventional error diffusion method.
For the convenience's sake, the following description refers to the case where a binary error diffusing process in which the output values are 1 or 2. As shown in FIG. 14A, there is no correlation between a total density value Ct as the sum of an input density value and an accumulated error value of the cyan component and a total density value Mt as the sum of an input density value and an accumulated error value of the magenta component, and the respective output values of the cyan and magenta components are determined to be 0 or 1 with a threshold thereof being set to 128. As shown in FIG. 14B, an output quantized value Cout determined for the cyan total density value Ct, an error value Error determined uniquely by the output quantized value Cout, and diffusion errors Error×W0 (abbreviated as E×W0), Error×W1 (abbreviated as E×W1), Error×W2 (abbreviated as E×W2), and Error×W3 (abbreviated as E×W3), which are weighted by respective predetermined weighting values W0, W1, W2, W3 based on the error value Error, can be collected into a table.
Tables 1 to 4 show detailed examples of values used for quantization of the cyan component. Detailed description of examples of values used for quantization of the magenta component is omitted.
TABLE 1CtCoutErrorExW0ExW1ExW2ExW30000.000.000.000.001010.440.310.190.062020.880.630.380.133031.310.940.560.194041.751.250.750.255052.191.560.940.316062.631.881.130.387073.062.191.310.448083.502.501.500.509093.942.811.690.56100104.383.131.880.63110114.813.442.060.69120125.253.752.250.75130135.694.062.440.81140146.134.382.630.88150156.564.692.810.94160167.005.003.001.00170177.445.313.191.06180187.885.633.381.13190198.315.943.561.19200208.756.253.751.25210219.196.563.941.31220229.636.884.131.382302310.067.194.311.442402410.507.504.501.502502510.947.814.691.562602611.388.134.881.632702711.818.445.061.692802812.258.755.251.752902912.699.065.441.813003013.139.385.631.883103113.569.695.811.943203214.0010.006.002.003303314.4410.316.192.063403414.8810.636.382.133503515.3110.946.562.193603615.7511.256.752.253703716.1911.566.942.313803816.6311.887.132.383903917.0612.197.312.444004017.5012.507.502.504104117.9412.817.692.564204218.3813.137.882.634304318.8113.448.062.694404419.2513.758.252.754504519.6914.068.442.814604620.1314.388.632.884704720.5614.698.812.944804821.0015.009.003.004904921.4415.319.193.065005021.8815.639.383.135105122.3115.949.563.195205222.7516.259.753.255305323.1916.569.943.315405423.6316.8810.133.385505524.0617.1910.313.445605624.5017.5010.503.505705724.9417.8110.693.565805825.3818.1310.883.635905925.8118.4411.063.696006026.2518.7511.253.756106126.6919.0611.443.816206227.1319.3811.633.886306327.5619.6911.813.94
TABLE 2CtCoutErrorExW0ExW1ExW2ExW36406428.0020.0012.004.006506528.4420.3112.194.066606628.8820.6312.384.136706729.3120.9412.564.196806829.7521.2512.754.256906930.1921.5612.944.317007030.6321.8813.134.387107131.0622.1913.314.447207231.5022.5013.504.507307331.9422.8113.694.567407432.3823.1313.884.637507532.8123.4414.064.697607633.2523.7514.254.757707733.6924.0614.444.817807834.1324.3814.634.887907934.5624.6914.814.948008035.0025.0015.005.008108135.4425.3115.195.068208235.8825.6315.385.138308336.3125.9415.565.198408436.7526.2515.755.258508537.1926.5615.945.318608637.6326.8816.135.388708738.0627.1916.315.448808838.5027.5016.505.508908938.9427.8116.695.569009039.3828.1316.885.639109139.8128.4417.065.699209240.2528.7517.255.759309340.6929.0617.445.819409441.1329.3817.635.889509541.5629.6917.815.949609642.0030.0018.006.009709742.4430.3118.196.069809842.8830.6318.386.139909943.3130.9418.566.19100010043.7531.2518.756.25101010144.1931.5618.946.31102010244.6331.8819.136.38103010345.0632.1919.316.44104010445.5032.5019.506.50105010545.9432.8119.696.56106010646.3833.1319.886.63107010746.8133.4420.066.69108010847.2533.7520.256.75109010947.6934.0620.446.81110011048.1334.3820.636.88111011148.5634.6920.816.94112011249.0035.0021.007.00113011349.4435.3121.197.06114011449.8835.6321.387.13115011550.3135.9421.567.19116011650.7536.2521.757.25117011751.1936.5621.947.31118011851.6336.8822.137.38119011952.0637.1922.317.44120012052.5037.5022.507.50121012152.9437.8122.697.56122012253.3838.1322.887.63123012353.8138.4423.067.69124012454.2538.7523.257.75125012554.6939.0623.447.81126012655.1339.3823.637.88127012755.5639.6923.817.94
TABLE 3CtCoutErrorExW0ExW1ExW2ExW31281−127−55.56−39.69−23.81−7.941291−126−55.13−39.38−23.63−7.881301−125−54.69−39.06−23.44−7.811311−124−54.25−38.75−23.25−7.751321−123−53.81−38.44−23.06−7.691331−122−53.38−38.13−22.88−7.631341−121−52.94−37.81−22.69−7.561351−120−52.50−37.50−22.50−7.501361−119−52.06−37.19−22.31−7.441371−118−51.63−36.88−22.13−7.381381−117−51.19−36.56−21.94−7.311391−116−50.75−36.25−21.75−7.251401−115−50.31−35.94−21.56−7.191411−114−49.88−35.63−21.38−7.131421−113−49.44−35.31−21.19−7.061431−112−49.00−35.00−21.00−7.001441−111−48.56−34.69−20.81−6.941451−110−48.13−34.38−20.63−6.881461−109−47.69−34.06−20.44−6.811471−108−47.25−33.75−20.25−6.751481−107−46.81−33.44−20.06−6.691491−106−46.38−33.13−19.88−6.631501−105−45.94−32.81−19.69−6.561511−104−45.50−32.50−19.50−6.501521−103−45.06−32.19−19.31−6.441531−102−44.63−31.88−19.13−6.381541−101−44.19−31.56−18.94−6.311551−100−43.75−31.25−18.75−6.251561−99−43.31−30.94−18.56−6.191571−98−42.88−30.63−18.38−6.131581−97−42.44−30.31−18.19−6.061591−96−42.00−30.00−18.00−6.001601−95−41.56−29.69−17.81−5.941611−94−41.13−29.38−17.63−5.881621−93−40.69−29.06−17.44−5.811631−92−40.25−28.75−17.25−5.751641−91−39.81−28.44−17.06−5.691651−90−39.38−28.13−16.88−5.631661−89−38.94−27.81−16.69−5.561671−88−38.50−27.50−16.50−5.501681−87−38.06−27.19−16.31−5.441691−86−37.63−26.88−16.13−5.381701−85−37.19−26.56−15.94−5.311711−84−36.75−26.25−15.75−5.251721−83−36.31−25.94−15.56−5.191731−82−35.88−25.63−15.38−5.131741−81−35.44−25.31−15.19−5.061751−80−35.00−25.00−15.00−5.001761−79−34.56−24.69−14.81−4.941771−78−34.13−24.38−14.63−4.881781−77−33.69−24.06−14.44−4.811791−76−33.25−23.75−14.25−4.751801−75−32.81−23.44−14.06−4.691811−74−32.38−23.13−13.88−4.631821−73−31.94−22.81−13.69−4.561831−72−31.50−22.50−13.50−4.501841−71−31.06−22.19−13.31−4.441851−70−30.63−21.88−13.13−4.381861−69−30.19−21.56−12.94−4.311871−68−29.75−21.25−12.75−4.251881−67−29.31−20.94−12.56−4.191891−66−28.88−20.63−12.38−4.131901−65−28.44−20.31−12.19−4.061911−64−28.00−20.00−12.00−4.00
TABLE 4CtCoutErrorExW0ExW1ExW2ExW31921−63−27.56−19.69−11.81−3.941931−62−27.13−19.38−11.63−3.881941−61−26.69−19.06−11.44−3.811951−60−26.25−18.75−11.25−3.751961−59−25.81−18.44−11.06−3.691971−58−25.38−18.13−10.88−3.631981−57−24.94−17.81−10.69−3.561991−56−24.50−17.50−10.50−3.502001−55−24.06−17.19−10.31−3.442011−54−23.63−16.88−10.13−3.382021−53−23.19−16.56−9.94−3.312031−52−22.75−16.25−9.75−3.252041−51−22.31−15.94−9.56−3.192051−50−21.88−15.63−9.38−3.132061−49−21.44−15.31−9.19−3.062071−48−21.00−15.00−9.00−3.002081−47−20.56−14.69−8.81−2.942091−46−20.13−14.38−8.63−2.882101−45−19.69−14.06−8.44−2.812111−44−19.25−13.75−8.25−2.752121−43−18.81−13.44−8.06−2.692131−42−18.38−13.13−7.88−2.632141−41−17.94−12.81−7.69−2.562151−40−17.50−12.50−7.50−2.502161−39−17.06−12.19−7.31−2.442171−38−16.63−11.88−7.13−2.382181−37−16.19−11.56−6.94−2.312191−36−15.75−11.25−6.75−2.252201−35−15.31−10.94−6.56−2.192211−34−14.88−10.63−6.38−2.132221−33−14.44−10.31−6.19−2.062231−32−14.00−10.00−6.00−2.002241−31−13.56−9.69−5.81−1.942251−30−13.13−9.38−5.63−1.882261−29−12.69−9.06−5.44−1.812271−28−12.25−8.75−5.25−1.752281−27−11.81−8.44−5.06−1.692291−26−11.38−8.13−4.88−1.632301−25−10.94−7.81−4.69−1.562311−24−10.50−7.50−4.50−1.502321−23−10.06−7.19−4.31−1.442331−22−9.63−6.88−4.13−1.382341−21−9.19−6.56−3.94−1.312351−20−8.75−6.25−3.75−1.252361−19−8.31−5.94−3.56−1.192371−18−7.88−5.63−3.38−1.132381−17−7.44−5.31−3.19−1.062391−16−7.00−5.00−3.00−1.002401−15−6.56−4.69−2.81−0.942411−14−6.13−4.38−2.63−0.882421−13−5.69−4.06−2.44−0.812431−12−5.25−3.75−2.25−0.752441−11−4.81−3.44−2.06−0.692451−10−4.38−3.13−1.88−0.632461−9−3.94−2.81−1.69−0.562471−8−3.50−2.50−1.50−0.502481−7−3.06−2.19−1.31−0.442491−6−2.63−1.88−1.13−0.382501−5−2.19−1.56−0.94−0.312511−4−1.75−1.25−0.75−0.252521−3−1.31−0.94−0.56−0.192531−2−0.88−0.63−0.38−0.132541−1−0.44−0.31−0.19−0.06255100.000.000.000.00
In the conventional error diffusion method, the values Cout and E×W0-E×W3 shown in FIG. 14B are calculated in advance, and the resulting values are held as an LUT (Look Up Table), and quantized output values and error values are acquired by referring to the LUT using the total density value Ct as parameters at the time of the actual error diffusion. Therefore, it is unnecessary to perform complicated multiplications and divisions, and hence perform error diffusion can be made at high speed.
Further, to output a multivalued image using inks of four colors consisting of cyan (C), magenta (M), yellow (Y), and black (K), a dithering process has been conventionally carried out in which error diffusion or the like is performed for individual colors independently of each other. Thus, even if visual characteristics are excellent in terms of a single color, favorable visual characteristics cannot be necessarily achieved in the case where two or more colors are overlapped.
To address this problem, Japanese Laid-Open Patent Publication (Kokai) No. 8-279920 and Japanese Laid-Open Patent Publication (Kokai) No. 11-10918, for example, have disclosed a pseudo halftoning process in which error diffusion is performed on two or more colors to achieve favorable visual characteristics even if two or more colors are overlapped.
Also, Japanese Laid-Open Patent Publication (Kokai) No. 9-139841 has disclosed a process in which dithering is performed individually for two or more colors, and then output values based on the sum of input values are corrected to thus improve the visual characteristics.
Particularly, as is known, to reduce the graininess of intermediate density regions of a color image, it is effective to form an image such that dots of the cyan component (C) and dots of the magenta component (M) are not overlapped. To this end, the following method has been employed. FIG. 15 is a view useful in explaining image formation control according to a conventional ink-jet printing method.
Here, it is assumed that image data is expressed as multivalued data in which density components (YMCK) of each pixel are each composed of 8 bits (gradation values of 0 to 255).
Where the density values of the C component and the M component of a notice pixel in a multivalued color image are designated by Ct and Mt, respectively, and the density values of the C component and the M component of the original image are designated by C and M, respectively, the density values Ct and Mt are expressed by:Ct=C+CerrMt=M+Merr
Here, Cerr and Merr represent accumulated error values obtained by error diffusion of the C component and M component, respectively, of the notice pixel.
When forming an image comprised of C and M components as shown in FIG. 15, control is provided in four ways according to the densities of the C component and M component of a notice pixel as described below.
1. If the sum of Ct and Mt is equal to or less than a threshold (Threshold 1), i.e. if the sum of Ct and Mt lies inside a region R1 of FIG. 15, dot-recording using C (cyan) ink and M (magenta) ink is not performed.
2. If the sum of Ct and Mt is greater than the threshold (Threshold 1) and less than another threshold (Threshold 2) and Ct is greater than Mt, i.e. if the sum of Ct and Mt lies inside a region R2 of FIG. 15, dot-recording using only C ink is performed.
3. If the sum of Ct and Mt is greater than the threshold (Threshold 1) and less than the other threshold (Threshold 2) and Ct is equal to or less than Mt, i.e. if the sum of Ct and Mt lies inside a region R3 of FIG. 15, dot-recording using only M ink is performed.
4. If the sum of Ct and Mt is equal to or greater than the threshold (Threshold 2), i.e. if the sum of Ct and Mt lies inside a region R4 of FIG. 15, dot-recording using C ink and M ink is performed.
It should be noted that the relation between the above-mentioned two thresholds is expressed by Threshold 1>Threshold 2.
However, it is impossible to directly apply to the error diffusing process comprised of a combination of processes of two or more colors, the conventional method in which a value of a binarization error weighted in advance is determined for every value of density information such that the sum of the determined values is equal to the binarization error, thus simplifying multiplications and divisions and eliminating roundoff errors (Japanese Laid-Open Patent Publication (Kokai) No. 63-35074). A description will now be given of the reason for this with reference to FIGS. 16A and 16B. FIGS. 16A and 16B are views useful in explaining problems of the conventional method to be solved. For the convenience's sake, the following description refers to a binary error diffusing process in which the output values are 1 or 2.
FIG. 16A shows the relationship between the total density value Ct as the sum of an input density value and an accumulated error value of the cyan component, the total density value Mt as the sum of an input density value and an accumulated error value of the magenta component, and output values of the cyan and magenta components. FIG. 16B shows the relationship between the total density value (about 120 in FIG. 16B) of the cyan component, cyan binarization thresholds, and quantization results. In FIG. 16B, at two points (704 and 705), a thick line 701 representing the total density value (about 120 in FIG. 16B) intersects a curved line 702 representing the binarization threshold. Thus, the output quantized value is 1 inside a hatched region 703 (Mt1≦Mt<Mt2), whereas the output quantized value is 0 inside other regions (Mt<Mt1, Mt2≦Mt).
As described above, in the error diffusion comprised of a combination of processes of two or more colors, different quantized values may be outputted with respect to the same total density value Ct. For this reason, the conventional method (Japanese Laid-Open Patent Publication (Kokai) No. 63-35074) cannot be applied as it is to the error diffusing process comprised of a combination of processes of two or more colors, and it is therefore difficult to perform error diffusion at high speed.